package com.gcsj.service.impl;

import com.gcsj.mapper.EnrollmentInfoMapper;
import com.gcsj.service.EnrollmentInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EnrollmentInfoServiceImpl implements EnrollmentInfoService {

    @Autowired
    EnrollmentInfoMapper enrPlanMapper;

//    @Override
//    public PageInfo<EnrollmentInfo> getEnrollmentInfoList(int pageNo, int pageSize) {
//
//        PageHelper.startPage(pageNo,pageSize);  //只有紧跟在 PageHelper.startPage 方法后的第一个 MyBatis 的查询(select)方法会被分页
//        List<EnrollmentInfo> list = enrPlanMapper.getEnrollmentInfosByPage();
//        PageInfo<EnrollmentInfo> pageInfo = new PageInfo<>(list);   // 用PageInfo对结果进行包装
//
//        return pageInfo;
//    }
//
//    @Override
//    public PageInfo<EnrollmentInfo> getEnrollmentInfoList(int pageNo, int pageSize, String schoolName, String profess,
//                                                          String province) {
//        System.out.println("param:schoolName-profess-province");
//        System.out.println(schoolName);
//        System.out.println(profess);
//        System.out.println(province);
//        if(schoolName != null && schoolName.equals("")){
//            schoolName = null;
//        }
//        if(profess != null && profess.equals("")){
//            profess = null;
//        }
//        if(province != null && province.equals("")){
//            province = null;
//        }
//        PageHelper.startPage(pageNo,pageSize);  //只有紧跟在 PageHelper.startPage 方法后的第一个 MyBatis 的查询(select)方法会被分页
//        List<EnrollmentInfo> list = enrPlanMapper.getEnrollmentinfos(schoolName, profess, province);
//        PageInfo<EnrollmentInfo> pageInfo = new PageInfo<>(list);   // 用PageInfo对结果进行包装
//
//        return pageInfo;
//    }
//
//    @Override
//    public PageInfo<EnrollmentInfo> getEnrollmentInfoList(int pageNo, int PageSize, EnrollmentInfo queryCondition) {
//
//        if(queryCondition == null){
//            return this.getEnrollmentInfoList(pageNo,PageSize);
//        }else{
//            return this.getEnrollmentInfoList(pageNo,PageSize,queryCondition.getSchoolName(),
//                    queryCondition.getProfess(),queryCondition.getProvince());
//        }
//
//    }
//
//
//    @Override
//    public List<EnrInfoResult> getMajorStatis(String schoolName, String province, boolean isDesc, int topn) {
//        List<EnrInfoResult> enrInfoResultList = null;
//        if (isDesc){
//            enrInfoResultList = enrPlanMapper.getTopNEnrollmentInfos(schoolName,province,"desc",topn);
//        }else{
//            enrInfoResultList = enrPlanMapper.getTopNEnrollmentInfos(schoolName,province,null,topn);
//        }
//
//        return enrInfoResultList;
//    }

}
